use "M:\Userdata\Current\Projects\Measuring Salience\Data\Analysis\Final\Measuring salience.dta", clear

** Data sources
* Interview-based salience measures: DEU project
* Number of recitals (ovrrec, purrec): own data
* Media coverage (mcae): own data

* Coding voting power (Shapley-Shubik)
** Source=Hix, The Political System of the European Union, 2nd edition
** Country codes from DEU
gen vpaus=0.045 
gen vpbel=0.055 
gen vpdk=0.035
gen vpfin=0.035
gen vpfrance=0.117
gen vpger=0.117
gen vpgrce=0.055
gen vpire=0.035
gen vpity=0.117
gen vplux=0.021
gen vpnl=0.055
gen vpport=0.055
gen vpspain=0.096
gen vpswed=0.045
gen vpuk=0.117

** creating aggregate salience values for each issue (across member states and legislative bodies)
egen scoumean=rowmean (sau sbel sdk sfin sfrance sger sgrce sire sity slux snl sport sspain sswed suk)
label var scoumean "Mean Salience Estimate for Council Members"
gen scouvp=vpaus*sau+vpbel*sbel+vpdk*sdk+vpfin*sfin+vpfrance*sfrance+vpger*sger+vpgrce*sgrce+vpire*sire+vpity*sity+vplux*slux+vpnl*snl+vpport*sport+vpspain*sspain+vpswed*sswed+vpuk*suk
label var scouvp "Weighted Mean (Voting Power) Salience Estimate for Council Members"
egen scoumin=rowmin (sau sbel sdk sfin sfrance sger sgrce sire sity slux snl sport sspain sswed suk)
egen scoumax=rowmax (sau sbel sdk sfin sfrance sger sgrce sire sity slux snl sport sspain sswed suk)
label var scoumax "Maximum Salience Estimate for Council Members"
gen scourange=abs(scoumin-scoumax) 
label variable scourange "Range of Salience Values"
egen smean=rowmean(scoumean sep scom)
label var smean "Mean Salience Value for all Legislative Bodies (Council: Mean)"
egen svp=rowmean(scouvp sep scom)
label var svp "Mean Salience Value for all Legislative Bodies (Council: Weighted Mean)"
egen smax=rowmean(scoumax sep scom)
label var smax "Mean Salience Value for all Legislative Bodies (Council: Maximum)"
egen smeanallmax=rowmax(scoumean sep scom)
label var smeanallmax "Maximum Salience Value (Council: Mean)"
egen svpallmax=rowmax(scouvp sep scom)
label var svpallmax "Maximum Salience Value (Council: Weighted Mean)"
egen smaxallmax=rowmax(scoumax sep scom)
label var smaxallmax "Maximum Salience Value (Council: Maximum)"
egen scousd=rowsd (sau sbel sdk sfin sfrance sger sgrce sire sity slux snl sport sspain sswed suk)
label var scousd "Standard Deviation of Salience Values for Member States"

hist scourange, percent bin (20) title ("Figure 1: Histogram of the Range of Salience Values for Member States") addlabopts(yvarformat(%2.1f)) xlabel(0(5)100) 
hist scousd, percent bin (20) addlabels addlabopts(yvarformat(%2.1f)) xlabel(0(5)50)
mean scourange
mean scousd

** Descriptive Statistics (issue-level)
sum scoumean
sum scouvp
sum scoumax
sum scom
sum sep

generate scoumaxbiggerscom=.
replace scoumaxbiggerscom=1 if scoumax>scom
replace scoumaxbiggerscom=0 if scoumax<=scom
tab scoumaxbiggerscom

** Relationship between interview-based measures (issue-level)
graph matrix scoumean scoumax scouvp scom sep, half
pwcorr scoumean scouvp scoumax scom sep, sig
scatter scoumean scouvp
spearman scoumean scouvp
scatter scoumean scoumax
spearman scoumean scoumax
scatter scoumean scom
spearman scoumean scom
scatter scoumean sep
spearman scoumean sep
scatter scouvp scoumax
spearman scouvp scoumax
scatter scouvp scom
spearman scouvp scom
scatter scouvp sep
spearman scouvp sep
scatter scoumax scom
spearman scoumax scom
scatter scoumax sep
spearman scoumax sep
scatter sep scom
spearman sep scom

** Creating salience values for each proposal (across issues) 

* Generating mean salience values for each proposal across issues
by proposalid, sort: egen scommeanprop=mean(scom)
label var scommeanprop "Interview Value Comission (mean, proposal)"
by proposalid, sort: egen scommaxprop=max(scom)
label var scommaxprop "Interview Value Comission (max, proposal)"
by proposalid, sort: egen sepmeanprop=mean(sep)
label var sepmeanprop "Interview Value EP (mean, proposal)"
by proposalid, sort: egen sepmaxprop=max(sep)
label var sepmaxprop "Interview Value EP (max, proposal)"
by proposalid, sort: egen scoumeanprop=mean(scoumean)
label var scoumeanprop "Interview Value Council, Mean (mean, proposal)"
by proposalid, sort: egen scoumaxprop=max(scoumean)
label var scoumaxprop "Interview Value Council, Mean (max, proposal)"
by proposalid, sort: egen scouvpmeanprop=mean(scouvp)
label var scouvpmeanprop "Interview Value Council, Weighted Mean (mean, proposal)"
by proposalid, sort: egen scouvpmaxprop=max(scouvp)
label var scouvpmaxprop "Interview Value Council, Weighted Mean (max, proposal)"
by proposalid, sort: egen scoumaxmeanprop=mean(scoumax)
label var scoumaxmeanprop "Interview Value Council, Maximum (mean, proposal)"
by proposalid, sort: egen scoumaxmaxprop=max(scoumax)
label var scoumaxmaxprop "Interview Value Council, Max (max, proposal)"
by proposalid, sort: egen smeanmeanprop=mean(smean)
label var smeanmeanprop "Mean Interview Value all Bodies, Council Mean (mean, proposal)"
by proposalid, sort: egen smeanmaxprop=max(smean)
label var smeanmaxprop "Mean Interview Value all Bodies, Council Mean (max, proposal)"
by proposalid, sort: egen svpmeanprop=mean(svp)
label var svpmeanprop "Mean Interview Value all Bodies, Council Weighted Mean (mean, proposal)"
by proposalid, sort: egen svpmaxprop=max(svp)
label var svpmaxprop "Mean Interview Value all Bodies, Council Weighted Mean (max, proposal)"
by proposalid, sort: egen smaxmeanprop=mean(smax)
label var smaxmeanprop "Mean Interview Value all Bodies, Council Maximum (mean, proposal)"
by proposalid, sort: egen smaxmaxprop=max(smax)
label var smaxmaxprop "Mean Interview Value all Bodies, Council Maximum (max, proposal)"
by proposalid, sort: egen smeanallmaxmeanprop=mean(smeanallmax)
label var smeanallmaxmeanprop "Maximum Value Estimate Salience All Bodies, Council Mean (mean, proposal)"
by proposalid, sort: egen smeanallmaxmaxprop=max(smeanallmax)
label var smeanallmaxmaxprop "Maximum Value Estimate Salience All Bodies, Council Mean (max, proposal)"
by proposalid, sort: egen svpallmaxmeanprop=mean(svpallmax)
label var svpallmaxmeanprop "Maximum Interview Value Salience All Bodies, Council Weighted Mean (mean, proposal)"
by proposalid, sort: egen svpallmaxmaxprop=max(svpallmax)
label var svpallmaxmaxprop "Maximum Interview Value Salience All Bodies, Council Weighted Mean (max, proposal)"
by proposalid, sort: egen smaxallmaxmeanprop=mean(smaxallmax)
label var smaxallmaxmeanprop "Maximum Interview Value Salience All Bodies, Council Maximum (mean, proposal)"
by proposalid, sort: egen smaxallmaxmaxprop=max(smaxallmax)
label var smaxallmaxmaxprop "Maximum Interview Value Salience All Bodies, Council Maximum (max, proposal)"


* Creating log transformation for Media Coverage
hist mcae
gen mcaelog=log(mcae)
label var mcaelog "Media Coverage Agence Europe (log)"
hist mcaelog

** Cleaning data set
* Eliminating split directive (COD/2000/062, CNS/2000/062B), first issue only because subsequent analysis is on proposal level with aggregate values
drop if isnr=="d00062i1"
drop if isnr=="n0062Bi1"

** Descriptive Statistics and Relationship between Recitals Measures (proposal-level)
histogram purrec if issueid=="1", frequency width (1)
codebook purrec if issueid=="1"
histogram ovrrec if issueid=="1", frequency
codebook ovrrec if issueid=="1"
histogram mcae if issueid=="1", frequency width(50)kdensity
histogram mcae if issueid=="1" & mcae<=2500, frequency width(50) kdensity
codebook mcae if issueid=="1"
histogram scommeanprop if issueid=="1", frequency width(5) xlabel (0 (5) 100) kdensity
codebook scommeanprop if issueid=="1"
histogram sepmeanprop if issueid=="1", frequency width(5) xlabel (0 (5) 100) kdensity
codebook sepmeanprop if issueid=="1"
histogram scoumeanprop if issueid=="1", frequency width(5) xlabel (0 (5) 100) kdensity
codebook scoumeanprop if issueid=="1"
histogram scouvpmeanprop if issueid=="1", frequency width(5) xlabel (0 (5) 100) kdensity
codebook scouvpmeanprop if issueid=="1"
histogram scoumaxmeanprop if issueid=="1", frequency width(5) xlabel (0 (5) 100) kdensity
codebook scoumaxmeanprop if issueid=="1"
histogram smeanmeanprop if issueid=="1", frequency width(5) xlabel (0 (5) 100) kdensity
codebook smeanmeanprop if issueid=="1"
histogram svpmeanprop if issueid=="1", frequency width(5) xlabel (0 (5) 100) kdensity
codebook svpmeanprop if issueid=="1"
histogram smaxmeanprop if issueid=="1", frequency width(5) xlabel (0 (5) 100) kdensity
codebook smaxmeanprop if issueid=="1"
histogram smeanallmaxmeanprop if issueid=="1", frequency width(5) xlabel (0 (5) 100) kdensity
codebook smeanallmaxmeanprop if issueid=="1"
histogram svpallmaxmeanprop if issueid=="1", frequency width(5) xlabel (0 (5) 100) kdensity
codebook svpallmaxmeanprop if issueid=="1"
histogram smaxallmaxmeanprop if issueid=="1", frequency width(5) xlabel (0 (5) 100) kdensity
codebook smaxallmaxmeanprop if issueid=="1"
histogram scommaxprop if issueid=="1", frequency width(5) xlabel (0 (5) 100) kdensity
codebook scommaxprop if issueid=="1"
histogram sepmaxprop if issueid=="1", frequency width(5) xlabel (0 (5) 100) kdensity
codebook sepmaxprop if issueid=="1"
histogram scoumaxprop if issueid=="1", frequency width(5) xlabel (0 (5) 100) kdensity
codebook scoumaxprop if issueid=="1"
histogram scouvpmaxprop if issueid=="1", frequency width(5) xlabel (0 (5) 100) kdensity
codebook scouvpmaxprop if issueid=="1"
histogram scoumaxmaxprop if issueid=="1", frequency width(5) xlabel (0 (5) 100) kdensity
codebook scoumaxmaxprop if issueid=="1"
histogram smeanmaxprop if issueid=="1", frequency width(5) xlabel (0 (5) 100) kdensity
codebook smeanmaxprop if issueid=="1"
histogram svpmaxprop if issueid=="1", frequency width(5) xlabel (0 (5) 100) kdensity
codebook svpmaxprop if issueid=="1"
histogram smaxmaxprop if issueid=="1", frequency width(5) xlabel (0 (5) 100) kdensity
codebook smaxmaxprop if issueid=="1"
histogram smeanallmaxmaxprop if issueid=="1", frequency width(5) xlabel (0 (5) 100) kdensity
codebook smeanallmaxmaxprop if issueid=="1"
histogram svpallmaxmaxprop if issueid=="1", frequency width(5) xlabel (0 (5) 100) kdensity
codebook svpallmaxmaxprop if issueid=="1"
histogram smaxallmaxmaxprop if issueid=="1", frequency width(5) xlabel (0 (5) 100) kdensity
codebook smaxallmaxmaxprop if issueid=="1"

spearman purrec ovrrec if issueid=="1"
corr purrec ovrrec if issueid=="1"
spearman ovrrec issues if issueid=="1"
graph matrix purrec ovrrec mcae mcaelog scommeanprop scommaxprop sepmeanprop sepmaxprop scoumeanprop scoumaxprop scouvpmeanprop scouvpmaxprop scoumaxmeanprop scoumaxmaxprop smeanmeanprop smeanmaxprop svpmeanprop svpmaxprop smaxmeanprop smaxmaxprop smeanallmaxmeanprop smeanallmaxmaxprop svpallmaxmeanprop svpallmaxmaxprop smaxallmaxmeanprop smaxallmaxmaxprop if issueid=="1", half
graph matrix purrec ovrrec mcae scommeanprop sepmeanprop scoumeanprop scouvpmeanprop scoumaxmeanprop smeanmeanprop smeanmaxprop smaxmaxprop smaxallmaxmeanprop smaxallmaxmaxprop if issueid=="1", half
graph matrix purrec ovrrec mcae scommeanprop sepmeanprop scoumeanprop scouvpmeanprop scoumaxmeanprop smeanmaxprop smaxmaxprop smaxallmaxmaxprop if issueid=="1", half
graph matrix ovrrec purrec mcae scommeanprop sepmeanprop scoumeanprop scouvpmeanprop scoumaxmeanprop if issueid=="1", half
graph matrix purrec mcae scommeanprop sepmeanprop scoumeanprop scoumaxmeanprop if issueid=="1", half
label var scommaxprop "Interview Value Comission"
label var sepmaxprop "Interview Value EP"
label var scoumaxmaxprop "Interview Value Council, Max"
label var scoumaxprop "Interview Value Council, Mean"
graph matrix purrec scommaxprop sepmaxprop scoumaxprop scoumaxmaxprop if issueid=="1", half title("Figure 2: Recitals and interview-based Salience Values")
label var scommaxprop "Interview Value Comission (max, proposal)"
label var sepmaxprop "Interview Value EP (max, proposal)"
label var scoumaxmaxprop "Interview Value Council, Max (max, proposal)"
label var scoumaxprop "Interview Value Council, Mean (max, proposal)"


** Relationship Different Salience Measures (proposal-level)

*Recitals and Expert Interviews
** Overall recitals - mean values across issues
scatter ovrrec scommeanprop if issueid=="1" 
spearman ovrrec scommeanprop if issueid=="1" 
scatter ovrrec sepmeanprop if issueid=="1"
spearman ovrrec sepmeanprop if issueid=="1" 
scatter ovrrec scoumeanprop  if issueid=="1" 
spearman ovrrec scoumeanprop if issueid=="1" 
scatter ovrrec scouvpmeanprop if issueid=="1" 
spearman ovrrec scouvpmeanprop if issueid=="1" 
scatter ovrrec scoumaxmeanprop if issueid=="1" 
spearman ovrrec scoumaxmeanprop if issueid=="1" 
scatter ovrrec smeanmeanprop if issueid=="1" 
spearman ovrrec smeanmeanprop if issueid=="1"
scatter ovrrec svpmeanprop if issueid=="1" 
spearman ovrrec svpmeanprop if issueid=="1"
scatter ovrrec smaxmeanprop if issueid=="1"
spearman ovrrec smaxmeanprop if issueid=="1"
scatter ovrrec smeanallmaxmeanprop if issueid=="1"
spearman ovrrec smeanallmaxmeanprop if issueid=="1"
scatter ovrrec svpallmaxmeanprop if issueid=="1"
spearman ovrrec svpallmaxmeanprop if issueid=="1"
scatter ovrrec smaxallmaxmeanprop if issueid=="1"
spearman ovrrec smaxallmaxmeanprop if issueid=="1"
** Overall recitals - maximum values across issues
scatter ovrrec scommaxprop if issueid=="1" 
spearman ovrrec scommaxprop if issueid=="1" 
scatter ovrrec sepmaxprop if issueid=="1"
spearman ovrrec sepmaxprop if issueid=="1" 
scatter ovrrec scoumaxprop  if issueid=="1" 
spearman ovrrec scoumaxprop if issueid=="1" 
scatter ovrrec scouvpmaxprop if issueid=="1" 
spearman ovrrec scouvpmaxprop if issueid=="1" 
scatter ovrrec scoumaxmaxprop if issueid=="1" 
spearman ovrrec scoumaxmaxprop if issueid=="1" 
scatter ovrrec smeanmaxprop if issueid=="1" 
spearman ovrrec smeanmaxprop if issueid=="1"
scatter ovrrec svpmaxprop if issueid=="1" 
spearman ovrrec svpmaxprop if issueid=="1"
scatter ovrrec smaxmaxprop if issueid=="1"
spearman ovrrec smaxmaxprop if issueid=="1"
scatter ovrrec smeanallmaxmaxprop if issueid=="1"
spearman ovrrec smeanallmaxmaxprop if issueid=="1"
scatter ovrrec svpallmaxmaxprop if issueid=="1"
spearman ovrrec svpallmaxmaxprop if issueid=="1"
scatter ovrrec smaxallmaxmaxprop if issueid=="1"
spearman ovrrec smaxallmaxmaxprop if issueid=="1"
** Pure recitals - mean values across issues
scatter purrec scommeanprop if issueid=="1" 
spearman purrec scommeanprop if issueid=="1" 
scatter purrec sepmeanprop if issueid=="1"
spearman purrec sepmeanprop if issueid=="1" 
scatter purrec scoumeanprop  if issueid=="1" 
spearman purrec scoumeanprop if issueid=="1" 
scatter purrec scouvpmeanprop if issueid=="1" 
spearman purrec scouvpmeanprop if issueid=="1" 
scatter purrec scoumaxmeanprop if issueid=="1" 
spearman purrec scoumaxmeanprop if issueid=="1" 
scatter purrec smeanmeanprop if issueid=="1" 
spearman purrec smeanmeanprop if issueid=="1"
scatter purrec svpmeanprop if issueid=="1" 
spearman purrec svpmeanprop if issueid=="1"
scatter purrec smaxmeanprop if issueid=="1"
spearman purrec smaxmeanprop if issueid=="1"
scatter purrec smeanallmaxmeanprop if issueid=="1"
spearman purrec smeanallmaxmeanprop if issueid=="1"
scatter purrec svpallmaxmeanprop if issueid=="1"
spearman purrec svpallmaxmeanprop if issueid=="1"
scatter purrec smaxallmaxmeanprop if issueid=="1"
spearman purrec smaxallmaxmeanprop if issueid=="1"
** Pure recitals - maximumm values across issues
scatter purrec scommaxprop if issueid=="1" 
spearman purrec scommaxprop if issueid=="1" 
scatter purrec sepmaxprop if issueid=="1"
spearman purrec sepmaxprop if issueid=="1" 
scatter purrec scoumaxprop  if issueid=="1" 
spearman purrec scoumaxprop if issueid=="1" 
scatter purrec scouvpmaxprop if issueid=="1" 
spearman purrec scouvpmaxprop if issueid=="1" 
scatter purrec scoumaxmaxprop if issueid=="1" 
spearman purrec scoumaxmaxprop if issueid=="1" 
scatter purrec smeanmaxprop if issueid=="1" 
spearman purrec smeanmaxprop if issueid=="1"
scatter purrec svpmaxprop if issueid=="1" 
spearman purrec svpmaxprop if issueid=="1"
scatter purrec smaxmaxprop if issueid=="1"
spearman purrec smaxmaxprop if issueid=="1"
scatter purrec smeanallmaxmaxprop if issueid=="1"
spearman purrec smeanallmaxmaxprop if issueid=="1"
scatter purrec svpallmaxmaxprop if issueid=="1"
spearman purrec svpallmaxmaxprop if issueid=="1"
scatter purrec smaxallmaxmaxprop if issueid=="1"
spearman purrec smaxallmaxmaxprop if issueid=="1"
** Media coverage and Expert Interview
* Mean values across issues
scatter mcae scommeanprop if issueid=="1" 
spearman mcae scommeanprop if issueid=="1" 
scatter mcae sepmeanprop if issueid=="1"
spearman mcae sepmeanprop if issueid=="1" 
scatter mcae scoumeanprop  if issueid=="1" 
spearman mcae scoumeanprop if issueid=="1" 
scatter mcae scouvpmeanprop if issueid=="1" 
spearman mcae scouvpmeanprop if issueid=="1" 
scatter mcae scoumaxmeanprop if issueid=="1" 
spearman mcae scoumaxmeanprop if issueid=="1" 
scatter mcae smeanmeanprop if issueid=="1" 
spearman mcae smeanmeanprop if issueid=="1"
scatter mcae svpmeanprop if issueid=="1" 
spearman mcae svpmeanprop if issueid=="1"
scatter mcae smaxmeanprop if issueid=="1"
spearman mcae smaxmeanprop if issueid=="1"
scatter mcae smeanallmaxmeanprop if issueid=="1"
spearman mcae smeanallmaxmeanprop if issueid=="1"
scatter mcae svpallmaxmeanprop if issueid=="1"
spearman mcae svpallmaxmeanprop if issueid=="1"
scatter mcae smaxallmaxmeanprop if issueid=="1"
spearman mcae smaxallmaxmeanprop if issueid=="1"
* Maximum values across issues
scatter mcae scommaxprop if issueid=="1" 
spearman mcae scommaxprop if issueid=="1" 
scatter mcae sepmaxprop if issueid=="1"
spearman mcae sepmaxprop if issueid=="1" 
scatter mcae scoumaxprop  if issueid=="1" 
spearman mcae scoumaxprop if issueid=="1" 
scatter mcae scouvpmaxprop if issueid=="1" 
spearman mcae scouvpmaxprop if issueid=="1" 
scatter mcae scoumaxmaxprop if issueid=="1" 
spearman mcae scoumaxmaxprop if issueid=="1" 
scatter mcae smeanmaxprop if issueid=="1" 
spearman mcae smeanmaxprop if issueid=="1"
scatter mcae svpmaxprop if issueid=="1" 
spearman mcae svpmaxprop if issueid=="1"
scatter mcae smaxmaxprop if issueid=="1"
spearman mcae smaxmaxprop if issueid=="1"
scatter mcae smeanallmaxmaxprop if issueid=="1"
spearman mcae smeanallmaxmaxprop if issueid=="1"
scatter mcae svpallmaxmaxprop if issueid=="1"
spearman mcae svpallmaxmaxprop if issueid=="1"
scatter mcae smaxallmaxmaxprop if issueid=="1"
spearman mcae smaxallmaxmaxprop if issueid=="1"
** Media coverage (logarithm) and Expert Interview
codebook mcae
sum mcae, detail
list if mcae==0 & issueid=="1" 
histogram mcae if issueid=="1", width(100) kdensity
codebook mcaelog
histogram mcaelog if issueid=="1", width(100) kdensity
* Mean values across issues
scatter mcaelog scommeanprop if issueid=="1" 
spearman mcaelog scommeanprop if issueid=="1" 
scatter mcaelog sepmeanprop if issueid=="1"
spearman mcaelog sepmeanprop if issueid=="1" 
scatter mcaelog scoumeanprop  if issueid=="1" 
spearman mcaelog scoumeanprop if issueid=="1" 
scatter mcaelog scouvpmeanprop if issueid=="1" 
spearman mcaelog scouvpmeanprop if issueid=="1" 
scatter mcaelog scoumaxmeanprop if issueid=="1" 
spearman mcaelog scoumaxmeanprop if issueid=="1" 
scatter mcaelog smeanmeanprop if issueid=="1" 
spearman mcaelog smeanmeanprop if issueid=="1"
scatter mcaelog svpmeanprop if issueid=="1" 
spearman mcaelog svpmeanprop if issueid=="1"
scatter mcaelog smaxmeanprop if issueid=="1"
spearman mcaelog smaxmeanprop if issueid=="1"
scatter mcaelog smeanallmaxmeanprop if issueid=="1"
spearman mcaelog smeanallmaxmeanprop if issueid=="1"
scatter mcaelog svpallmaxmeanprop if issueid=="1"
spearman mcaelog svpallmaxmeanprop if issueid=="1"
scatter mcaelog smaxallmaxmeanprop if issueid=="1"
spearman mcaelog smaxallmaxmeanprop if issueid=="1"
* Maximum values across issues
scatter mcaelog scommaxprop if issueid=="1" 
spearman mcaelog scommaxprop if issueid=="1" 
scatter mcaelog sepmaxprop if issueid=="1"
spearman mcaelog sepmaxprop if issueid=="1" 
scatter mcaelog scoumaxprop  if issueid=="1" 
spearman mcaelog scoumaxprop if issueid=="1" 
scatter mcaelog scouvpmaxprop if issueid=="1" 
spearman mcaelog scouvpmaxprop if issueid=="1" 
scatter mcaelog scoumaxmaxprop if issueid=="1" 
spearman mcaelog scoumaxmaxprop if issueid=="1" 
scatter mcaelog smeanmaxprop if issueid=="1" 
spearman mcaelog smeanmaxprop if issueid=="1"
scatter mcaelog svpmaxprop if issueid=="1" 
spearman mcaelog svpmaxprop if issueid=="1"
scatter mcaelog smaxmaxprop if issueid=="1"
spearman mcaelog smaxmaxprop if issueid=="1"
scatter mcaelog smeanallmaxmaxprop if issueid=="1"
spearman mcaelog smeanallmaxmaxprop if issueid=="1"
scatter mcaelog svpallmaxmaxprop if issueid=="1"
spearman mcaelog svpallmaxmaxprop if issueid=="1"
scatter mcaelog smaxallmaxmaxprop if issueid=="1"
spearman mcaelog smaxallmaxmaxprop if issueid=="1"

pwcorr ovrrec purrec mcae mcaelog scommeanprop scommaxprop sepmeanprop sepmaxprop scoumeanprop scoumaxprop scouvpmeanprop scouvpmaxprop scoumaxmeanprop scoumaxmaxprop smeanmeanprop smeanmaxprop svpmeanprop svpmaxprop smaxmeanprop smaxmaxprop smeanallmaxmeanprop smeanallmaxmaxprop svpallmaxmeanprop svpallmaxmaxprop smaxallmaxmeanprop smaxallmaxmaxprop if issueid=="1", sig

** Media Coverage and Recitals
scatter mcae ovrrec if issueid=="1"
scatter mcae purrec if issueid=="1"
spearman mcae ovrrec if issueid=="1"
spearman mcae purrec if issueid=="1"
*Transformed values
scatter mcaelog ovrrec if issueid=="1"
scatter mcaelog purrec if issueid=="1"
spearman mcaelog ovrrec if issueid=="1"
spearman mcaelog purrec if issueid=="1"
*Outlier
scatter mcae ovrrec if issueid=="1", mlabel(proposalid)
spearman mcae ovrrec if issueid=="1" & proposalid~="d97359" & proposalid~="n98110" & proposalid~="n98109"
scatter mcae purrec if issueid=="1", mlabel(proposalid)
spearman mcae purrec if issueid=="1" & proposalid~="d97359" & proposalid~="n98110" & proposalid~="n98109"
spearman mcaelog ovrrec if issueid=="1" & proposalid~="d97359" & proposalid~="n98110" & proposalid~="n98109"
spearman mcaelog purrec if issueid=="1" & proposalid~="d97359" & proposalid~="n98110" & proposalid~="n98109"

** Relationship between Recitals and Number of issues
label var issues "Number of issues"
graph box ovrrec if issueid=="1", over(issues)
graph box purrec if issueid=="1", over(issues) 
spearman ovrrec issues if issueid=="1"
spearman purrec issues if issueid=="1"
* Recoding issues (4 categories)
tab issues if issueid=="1"
gen issuescl4=.
label var issuescl4 "Number of issues"
label define issuescl4lab 1 "1" 2 "2" 3 "3" 4 "4 or more"
label values issuescl4 issuescl4lab
replace issuescl4=issues
replace issuescl4=4 if issues==5
replace issuescl4=4 if issues==6
tab issuescl4 if issueid=="1" & ovrrec~=.
scatter ovrrec issuescl4  if issueid=="1"
graph box ovrrec if issueid=="1", over(issuescl4) 
graph box purrec if issueid=="1", over(issuescl4) 
spearman ovrrec issuescl4 if issueid=="1"
spearman purrec issuescl4 if issueid=="1"
spearman mcae issuescl4 if issueid=="1"
pwcorr issuescl4 ovrrec purrec mcae if issueid=="1", sig

* Recoding issues (3 categories)
gen issuescl3=. 
replace issuescl3=issues
replace issuescl3=1 if issues==2
replace issuescl3=2 if issues==3
replace issuescl3=3 if issues==4
replace issuescl3=3 if issues==5
replace issuescl3=3 if issues==6
tab issuescl3 if issueid=="1"
graph box ovrrec if issueid=="1", over(issuescl3) 
graph box purrec if issueid=="1", over(issuescl3) 
spearman ovrrec issuescl3 if issueid=="1"
spearman purrec issuescl3 if issueid=="1"

** Relationship between Media Coverage and Issues
spearman issues mcae if issueid=="1"
spearman issues mcaelog if issueid=="1"
spearman issuescl4 mcae if issueid=="1"
spearman issuescl4 mcaelog if issueid=="1"
pwcorr issuescl4 issues ovrrec purrec mcae mcaelog if issueid=="1", sig

** Factor Analysis (not reported)
factor issues ovrrec purrec mcae scommeanprop scommaxprop sepmeanprop sepmaxprop scoumeanprop scoumaxprop scouvpmeanprop scouvpmaxprop scoumaxmeanprop scoumaxmaxprop smeanmeanprop smeanmaxprop svpmeanprop svpmaxprop smaxmeanprop smaxmaxprop smeanallmaxmeanprop smeanallmaxmaxprop svpallmaxmeanprop svpallmaxmaxprop smaxallmaxmeanprop smaxallmaxmaxprop if issueid=="1", mineigen(1)
screeplot, mean
factor issues ovrrec mcae scommaxprop sepmaxprop scoumaxprop scouvpmaxprop scoumaxmaxprop smeanmaxprop svpmaxprop smaxmaxprop smeanallmaxmaxprop svpallmaxmaxprop smaxallmaxmaxprop if issueid=="1", mineigen(1)
screeplot, mean
factor issues ovrrec mcae scommaxprop sepmaxprop scoumaxprop scouvpmaxprop scoumaxmaxprop smeanmaxprop if issueid=="1", mineigen(1)
screeplot, mean
rotate
factor issues ovrrec mcae scommaxprop sepmaxprop scoumaxprop smeanmaxprop if issueid=="1", mineigen(1)
screeplot, mean
rotate

** Values for Salience Measures and Procedural Aspects (not reported)
sort council
by council: sum smeanmeanprop if issueid=="1"
by council: sum scommeanprop if issueid=="1"
by council: sum scoumeanprop if issueid=="1"
by council: sum sepmeanprop if issueid=="1"
by council: sum ovrrec if issueid=="1"
by council: sum mcae if issueid=="1"
sort neworam
by neworam: sum smeanmeanprop if issueid=="1"
by neworam: sum scommeanprop if issueid=="1"
by neworam: sum scoumeanprop if issueid=="1"
by neworam: sum sepmeanprop if issueid=="1"
by neworam: sum ovrrec if issueid=="1"
by neworam: sum mcae if issueid=="1"
sort type
by type: sum smeanmeanprop if issueid=="1"
by type: sum scommeanprop if issueid=="1"
by type: sum scoumeanprop if issueid=="1"
by type: sum sepmeanprop if issueid=="1"
by type: sum ovrrec if issueid=="1"
by type: sum mcae if issueid=="1"
* Differences across groups
ttest smeanmeanprop  if issueid=="1", by(neworam) unequal
ttest scommeanprop  if issueid=="1", by (neworam) unequal
ttest scoumeanprop if issueid=="1", by(neworam) unequal
ttest sepmeanprop if issueid=="1", by (neworam) unequal
ttest ovrrec if issueid=="1", by (neworam) unequal
ttest mcae if issueid=="1", by (neworam) unequal
ranksum smeanmeanprop if issueid=="1", by(neworam)
ranksum scommeanprop if issueid=="1", by(neworam)
ranksum scoumeanprop if issueid=="1", by(neworam)
ranksum sepmeanprop if issueid=="1", by(neworam)
ranksum ovrrec if issueid=="1", by(neworam)
ranksum mcae if issueid=="1", by(neworam)
oneway smeanmeanprop type if issueid=="1", tabulate
kwallis smeanmeanprop  if issueid=="1", by(type)
oneway scommeanprop type  if issueid=="1", tabulate
kwallis scommeanprop  if issueid=="1", by(type)
oneway scoumeanprop type  if issueid=="1", tabulate
kwallis scoumeanprop  if issueid=="1", by(type)
oneway sepmeanprop type if issueid=="1", tabulate
kwallis sepmeanprop if issueid=="1", by(type)
oneway ovrrec type if issueid=="1", tabulate
kwallis ovrrec if issueid=="1", by(type)
oneway mcae type if issueid=="1", tabulate
kwallis mcae if issueid=="1", by(type)
